import Entity from './entity'

export default class Ajax extends Entity {
    constructor(db) {
        super(db, 'ajaxs')
    }

    async getAllByPage(page) {
        const list = await this.find(page ? { page } : {})
        return list
    }

    genToAddItem(item) {
        return {
            contentType: item.contentType,
            url: item.url,
            remark: item.remark,
            page: item.page
        }
    }

    genToUpdateItem(item) {
        return {
            contentType: item.contentType,
            url: item.url,
            remark: item.remark
        }
    }
}